/**
 * Project Name:sc-parent-service
 * File Name:AgeProbabilityImpl.java
 * Package Name:com.sc.probability.impl
 * Date:2018年6月28日下午10:44:03
 * Copyright (c) 2018, bluemobi All Rights Reserved.
 */

package com.sc.probability.impl;

import com.sc.pojo.Customer;
import com.sc.probability.Probability;

/**
 * Description:计算年龄的概率   <br/>
 * Date:     2018年6月28日 下午10:44:03 <br/>
 * @author   tianyongxu
 * @version
 * @see
 */
public class AgeProbabilityImpl implements Probability{

    @Override
    public float getProbability(Customer customer) {
        
        float ageProbability = 0.0f;
        if (customer.getCage() != null) {
            if (customer.getCage() < 20) {
                ageProbability = 0.05f;
            }if (customer.getCage() < 30) {
                ageProbability = 0.15f;
            }if (customer.getCage() < 40) {
                ageProbability = 0.10f;
            }if (customer.getCage() < 50) {
                ageProbability = 0.10f;
            }if (customer.getCage() < 60) {
                ageProbability = 0.05f;
            }if (customer.getCage() < 80) {
                ageProbability = 0.01f;
            }
        }
        return ageProbability;
    }

}

